"use strict";
(self["webpackChunktoknow"] = self["webpackChunktoknow"] || []).push([[470],{

/***/ 8628:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ BaseInput)
});

// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
// EXTERNAL MODULE: ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
var runtime_dom_esm_bundler = __webpack_require__(9963);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/Input/BaseInput.vue?vue&type=template&id=113f2cd4&scoped=true


const _withScopeId = n => (_pushScopeId("data-v-113f2cd4"),n=n(),_popScopeId(),n)
const _hoisted_1 = { class: "log-base-input-wrapper" }
const _hoisted_2 = ["placeholder", "value"]

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div", _hoisted_1, [
    (0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
      type: "text",
      placeholder: $props.placeholder,
      ref: "input",
      value: $props.value,
      onChange: _cache[0] || (_cache[0] = (0,runtime_dom_esm_bundler/* withModifiers */.iM)($event => ($options.submitChange($event)), ["stop"])),
      onInput: _cache[1] || (_cache[1] = $event => ($options.emitChange($event)))
    }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_2)
  ]))
}
;// CONCATENATED MODULE: ./src/components/utils/Input/BaseInput.vue?vue&type=template&id=113f2cd4&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/Input/BaseInput.vue?vue&type=script&lang=js

  /* harmony default export */ const BaseInputvue_type_script_lang_js = ({
    props: ['placeholder', 'value'],
    emits: ['update:value', 'change'],
    methods: {
      focus() {
        this.$refs.input.focus();
      },
      submitChange(e) {
        this.$emit('change', e);
      },
      emitChange(e) {
        this.$emit('update:value', e.target.value);
      }
    },
  });

;// CONCATENATED MODULE: ./src/components/utils/Input/BaseInput.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/components/utils/Input/BaseInput.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(BaseInputvue_type_script_lang_js, [['render',render],['__scopeId',"data-v-113f2cd4"]])

/* harmony default export */ const BaseInput = (__exports__);

/***/ }),

/***/ 8585:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _TextArea_vue_vue_type_template_id_8551dff6_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6076);
/* harmony import */ var _TextArea_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1061);
/* harmony import */ var D_Project_ToKnow_Front_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3744);




;


const __exports__ = /*#__PURE__*/(0,D_Project_ToKnow_Front_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(_TextArea_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, [['render',_TextArea_vue_vue_type_template_id_8551dff6_scoped_true__WEBPACK_IMPORTED_MODULE_0__/* .render */ .s],['__scopeId',"data-v-8551dff6"]])

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);

/***/ }),

/***/ 6766:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });

  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    props: {
      value: {
        type: String,
        default: () => ''
      },
    },
    emits: ['update:value'],
    methods: {
      handleInput(event) {
        this.$emit('update:value', event.target.value)
      }
    },
  });


/***/ }),

/***/ 4470:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ PubArticle)
});

// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/PubArticle.vue?vue&type=template&id=5129fa5a&scoped=true


function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_rich_text_editor = (0,runtime_core_esm_bundler/* resolveComponent */.up)("rich-text-editor")
  const _component_article_infos_choice = (0,runtime_core_esm_bundler/* resolveComponent */.up)("article-infos-choice")

  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div", null, [
    (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_rich_text_editor, {
      class: "rich-text-editor",
      ref: "RTF",
      onStore: $options.autoUpdateDraft
    }, null, 8 /* PROPS */, ["onStore"]),
    (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_article_infos_choice, {
      class: "article-infos-choice",
      ref: "AIC",
      onSubmitArticle: $options.submitArticle,
      onStoreArticle: $options.storeArticle,
      onUpdateArticleDraft: $options.updateArticleDraft
    }, null, 8 /* PROPS */, ["onSubmitArticle", "onStoreArticle", "onUpdateArticleDraft"])
  ]))
}
// EXTERNAL MODULE: ./src/utils/assert.js
var assert = __webpack_require__(4442);
// EXTERNAL MODULE: ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
var runtime_dom_esm_bundler = __webpack_require__(9963);
// EXTERNAL MODULE: ./node_modules/@vue/shared/dist/shared.esm-bundler.js
var shared_esm_bundler = __webpack_require__(3577);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/RTF/RichTextEditor.vue?vue&type=template&id=bef1ad5c&scoped=true


const _withScopeId = n => (_pushScopeId("data-v-bef1ad5c"),n=n(),_popScopeId(),n)
const _hoisted_1 = { class: "rich-text-editor-wrapper" }
const _hoisted_2 = { class: "util-list-wrapper" }
const _hoisted_3 = { class: "util-list" }
const _hoisted_4 = ["onMousedown", "onMouseenter", "onMouseleave"]
const _hoisted_5 = ["onClick"]
const _hoisted_6 = {
  class: "display",
  ref: "display"
}
const _hoisted_7 = ["src"]

function RichTextEditorvue_type_template_id_bef1ad5c_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_insert_link = (0,runtime_core_esm_bundler/* resolveComponent */.up)("insert-link")
  const _component_pop_up = (0,runtime_core_esm_bundler/* resolveComponent */.up)("pop-up")

  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div", _hoisted_1, [
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_2, [
      (0,runtime_core_esm_bundler/* createElementVNode */._)("ul", _hoisted_3, [
        ((0,runtime_core_esm_bundler/* openBlock */.wg)(true), (0,runtime_core_esm_bundler/* createElementBlock */.iD)(runtime_core_esm_bundler/* Fragment */.HY, null, (0,runtime_core_esm_bundler/* renderList */.Ko)($data.utilIcons, (util, idx) => {
          return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("li", {
            key: idx,
            onMousedown: (0,runtime_dom_esm_bundler/* withModifiers */.iM)($event => ($options.clickIcon(util)), ["prevent"]),
            onMouseenter: $event => ($options.showChoices(util)),
            onMouseleave: $event => ($options.fadeChoices(util))
          }, [
            (0,runtime_core_esm_bundler/* createElementVNode */._)("h2", {
              class: (0,shared_esm_bundler/* normalizeClass */.C_)(["iconfont", util.iconClass])
            }, null, 2 /* CLASS */),
            (0,runtime_core_esm_bundler/* createElementVNode */._)("h3", null, (0,shared_esm_bundler/* toDisplayString */.zw)(util.showName), 1 /* TEXT */),
            (util.name==='imageFill')
              ? ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("input", {
                  key: 0,
                  type: "file",
                  class: "image-upload",
                  onChange: _cache[0] || (_cache[0] = $event => ($options.addImg($event))),
                  title: ""
                }, null, 32 /* HYDRATE_EVENTS */))
              : (0,runtime_core_esm_bundler/* createCommentVNode */.kq)("v-if", true),
            (util.choices)
              ? ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("ul", {
                  key: 1,
                  class: (0,shared_esm_bundler/* normalizeClass */.C_)(["util-choices", {fadeOut: !util.showChoices}])
                }, [
                  ((0,runtime_core_esm_bundler/* openBlock */.wg)(true), (0,runtime_core_esm_bundler/* createElementBlock */.iD)(runtime_core_esm_bundler/* Fragment */.HY, null, (0,runtime_core_esm_bundler/* renderList */.Ko)(util.choices, (choice, idx) => {
                    return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("li", {
                      key: idx,
                      onClick: $event => ($options.clickChoice(util, choice))
                    }, (0,shared_esm_bundler/* toDisplayString */.zw)(choice.cover), 9 /* TEXT, PROPS */, _hoisted_5))
                  }), 128 /* KEYED_FRAGMENT */))
                ], 2 /* CLASS */))
              : (0,runtime_core_esm_bundler/* createCommentVNode */.kq)("v-if", true)
          ], 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_4))
        }), 128 /* KEYED_FRAGMENT */))
      ])
    ]),
    (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_pop_up, {
      class: "insert-link-popup",
      fadeIn: $data.showInsertLink
    }, {
      default: (0,runtime_core_esm_bundler/* withCtx */.w5)(() => [
        (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_insert_link, {
          class: "insert-link",
          onExit: _cache[1] || (_cache[1] = $event => ($data.showInsertLink = false)),
          onSubmit: $options.insertLink
        }, null, 8 /* PROPS */, ["onSubmit"])
      ]),
      _: 1 /* STABLE */
    }, 8 /* PROPS */, ["fadeIn"]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_6, [
      (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
        class: "title",
        placeholder: "请输入标题",
        "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (($data.article.title) = $event))
      }, null, 512 /* NEED_PATCH */), [
        [runtime_dom_esm_bundler/* vModelText */.nr, $data.article.title]
      ]),
      (0,runtime_core_esm_bundler/* createElementVNode */._)("iframe", {
        src: _ctx.$routeBaseURL + '/RTF.html',
        ref: "main",
        width: "100%",
        height: "100%",
        frameborder: "0",
        class: "main"
      }, null, 8 /* PROPS */, _hoisted_7)
    ], 512 /* NEED_PATCH */)
  ]))
}
;// CONCATENATED MODULE: ./src/components/utils/RTF/RichTextEditor.vue?vue&type=template&id=bef1ad5c&scoped=true

;// CONCATENATED MODULE: ./src/assets/js/utils.js
// 下划线转换驼峰
function toHump(name) {
  return name.replace(/_(\w)/g, function(all, letter){
      return letter.toUpperCase();
  });
}
// 驼峰转换下划线
function toLine(name) {
  return name.replace(/([A-Z])/g,"_$1").toLowerCase();
}

function objKeyToHump(obj) {
  Object.keys(obj).forEach(key => {
    obj[toHump(key)] = obj[key];
  });
  return obj;
}

function getQueryObj() {
  let query = location.search.substring(1);
  let queryList = query.split('&');
  let obj = {};
  queryList.forEach(str => {
    let idx = str.indexOf('=');
    let key = decodeURIComponent(str.substring(0, idx));
    let value = decodeURIComponent(str.substring(idx + 1));
    obj[key] = value;
  });
  return obj;
}

// comporess img
const compressImg = (file) => new Promise((resolve) => {
  let canvas = document.createElement('canvas');
  let ctx = canvas.getContext('2d');

  let img = new Image();
  let url = URL.createObjectURL(file);

  img.onload = () => {
    URL.revokeObjectURL(url);

    let w, h;

    const ratio = img.height / img.width;
    w = Math.min(400, img.width);
    h = w * ratio;

    canvas.width = w;
    canvas.height = h;

    ctx.drawImage(img, 0, 0, w, h);
    canvas.toBlob(blob => {
      const f = new File([blob], file.name, {
        type: file.type,
        lastModified: file.lastModified
      });
      resolve(f);
    }, 'image/png');
  }
  
  img.src = url;
})

/* harmony default export */ const utils = ({
  toHump,
  toLine,
  objKeyToHump,
  getQueryObj,
  compressImg
});
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/PopUp.vue?vue&type=template&id=f9439f00&scoped=true


const PopUpvue_type_template_id_f9439f00_scoped_true_withScopeId = n => ((0,runtime_core_esm_bundler/* pushScopeId */.dD)("data-v-f9439f00"),n=n(),(0,runtime_core_esm_bundler/* popScopeId */.Cn)(),n)
const PopUpvue_type_template_id_f9439f00_scoped_true_hoisted_1 = /*#__PURE__*/ PopUpvue_type_template_id_f9439f00_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("div", { class: "bg" }, null, -1 /* HOISTED */))
const PopUpvue_type_template_id_f9439f00_scoped_true_hoisted_2 = { class: "card" }

function PopUpvue_type_template_id_f9439f00_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div", {
    class: (0,shared_esm_bundler/* normalizeClass */.C_)(["wrapper", {fadeOut: !$props.fadeIn}])
  }, [
    PopUpvue_type_template_id_f9439f00_scoped_true_hoisted_1,
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", PopUpvue_type_template_id_f9439f00_scoped_true_hoisted_2, [
      (0,runtime_core_esm_bundler/* renderSlot */.WI)(_ctx.$slots, "default", {}, undefined, true)
    ])
  ], 2 /* CLASS */))
}
;// CONCATENATED MODULE: ./src/components/utils/PopUp.vue?vue&type=template&id=f9439f00&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/PopUp.vue?vue&type=script&lang=js

  /* harmony default export */ const PopUpvue_type_script_lang_js = ({
    props: {
      fadeIn: {
        type: Boolean,
        default: () => false
      },
    },
  });

;// CONCATENATED MODULE: ./src/components/utils/PopUp.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/components/utils/PopUp.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(PopUpvue_type_script_lang_js, [['render',PopUpvue_type_template_id_f9439f00_scoped_true_render],['__scopeId',"data-v-f9439f00"]])

/* harmony default export */ const PopUp = (__exports__);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/RTF/InsertLink.vue?vue&type=template&id=4367c0ed&scoped=true


const InsertLinkvue_type_template_id_4367c0ed_scoped_true_withScopeId = n => ((0,runtime_core_esm_bundler/* pushScopeId */.dD)("data-v-4367c0ed"),n=n(),(0,runtime_core_esm_bundler/* popScopeId */.Cn)(),n)
const InsertLinkvue_type_template_id_4367c0ed_scoped_true_hoisted_1 = { class: "insert-link-wrapper" }
const InsertLinkvue_type_template_id_4367c0ed_scoped_true_hoisted_2 = /*#__PURE__*/ InsertLinkvue_type_template_id_4367c0ed_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", null, "输入链接", -1 /* HOISTED */))

function InsertLinkvue_type_template_id_4367c0ed_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_base_input = (0,runtime_core_esm_bundler/* resolveComponent */.up)("base-input")

  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div", InsertLinkvue_type_template_id_4367c0ed_scoped_true_hoisted_1, [
    InsertLinkvue_type_template_id_4367c0ed_scoped_true_hoisted_2,
    (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_base_input, {
      class: "href-input",
      placeholder: "链接",
      value: $data.href,
      "onUpdate:value": _cache[0] || (_cache[0] = $event => (($data.href) = $event))
    }, null, 8 /* PROPS */, ["value"]),
    (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_base_input, {
      class: "cover-input",
      placeholder: "字段",
      value: $data.cover,
      "onUpdate:value": _cache[1] || (_cache[1] = $event => (($data.cover) = $event))
    }, null, 8 /* PROPS */, ["value"]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("button", {
      class: "submit",
      onClick: _cache[2] || (_cache[2] = (...args) => ($options.submit && $options.submit(...args)))
    }, "确认"),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("i", {
      class: "iconfont icon-cancel",
      onClick: _cache[3] || (_cache[3] = $event => (this.$emit('exit')))
    })
  ]))
}
;// CONCATENATED MODULE: ./src/components/utils/RTF/InsertLink.vue?vue&type=template&id=4367c0ed&scoped=true

// EXTERNAL MODULE: ./src/components/utils/Input/BaseInput.vue + 4 modules
var BaseInput = __webpack_require__(8628);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/RTF/InsertLink.vue?vue&type=script&lang=js



  /* harmony default export */ const InsertLinkvue_type_script_lang_js = ({
    components: {
      BaseInput: BaseInput/* default */.Z,
    },
    data() {
      return {
        cover: '',
        href: ''
      }
    },
    methods: {
      submit() {
        this.$emit('submit', {
          cover: this.cover,
          href: this.href
        })
      }
    },
  });

;// CONCATENATED MODULE: ./src/components/utils/RTF/InsertLink.vue?vue&type=script&lang=js
 
;// CONCATENATED MODULE: ./src/components/utils/RTF/InsertLink.vue




;


const InsertLink_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(InsertLinkvue_type_script_lang_js, [['render',InsertLinkvue_type_template_id_4367c0ed_scoped_true_render],['__scopeId',"data-v-4367c0ed"]])

/* harmony default export */ const InsertLink = (InsertLink_exports_);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/RTF/RichTextEditor.vue?vue&type=script&lang=js






  /* harmony default export */ const RichTextEditorvue_type_script_lang_js = ({
    components: {
      PopUp: PopUp,
      InsertLink: InsertLink
    },
    emits: ['store'],
    data() {
      return {
        utilIcons: [
          {
            iconClass: 'icon-unorderedlist',
            name: 'unorderedlist',
            showName: '无序列表',
            tag: {
              name: 'ul > li',
              type: 'block'
            }
          },
          {
            iconClass: 'icon-orderedlist',
            name: 'orderedlist',
            showName: '有序列表',
            tag: {
              name: 'ol > li',
              type: 'block'
            }
          },
          {
            iconClass: 'icon-bold',
            name: 'bold',
            showName: '加粗',
            tag: {
              name: 'b',
              type: 'inline'
            }
          },
          {
            iconClass: 'icon-title',
            name: 'title',
            showName: '标题',
            tag: {
              name: 'h1 > p',
              type: 'block'
            },
            choices: [
              {
                cover: '一级标题',
                tag: {
                  name: 'h1 > p'
                }
              },
              {
                cover: '二级标题',
                tag: {
                  name: 'h2 > p'
                }
              },
              {
                cover: '三级标题',
                tag: {
                  name: 'h3 > p'
                }
              },
              {
                cover: '四级标题',
                tag: {
                  name: 'h4 > p'
                }
              }
            ],
            showChoices: false
          },
          {
            iconClass: 'icon-font-colors',
            name: 'fontColors',
            showName: '颜色',
            tag: {
              name: 'span',
              type: 'inline'
            },
            choices: [
              {
                cover: '红色',
                tag: {
                  style: {
                    color: 'red'
                  }
                }
              },
              {
                cover: '黄色',
                tag: {
                  style: {
                    color: '#ffcc11'
                  }
                }
              },
              {
                cover: '蓝色',
                tag: {
                  style: {
                    color: 'blue'
                  }
                }
              }
            ],
            showChoices: false
          },
          {
            iconClass: 'icon-image-fill',
            name: 'imageFill',
            showName: '图片',
            tag: {
              name: 'img',
              type: 'block'
            }
          },
          {
            iconClass: 'icon-quote',
            name: 'blockquote',
            showName: '引用',
            tag: {
              name: 'blockquote > p',
              type: 'block'
            }
          },
          {
            iconClass: 'icon-code',
            name: 'code',
            showName: '代码段',
            tag: {
              name: 'code > p',
              type: 'block'
            }
          },
          {
            iconClass: 'icon-link',
            name: 'link',
            showName: '链接',
            tag: {
              name: 'a',
              type: 'inline'
            }
          }
        ],
        article: {
          title: '',
          content: '',
          text: '',
        },
        showInsertLink: false,
        iframeWindowState: 0,
      }
    },
    methods: {
      addTag(tag) {
        let main = this.$refs.main;
        let win = main.contentWindow;
        win.postMessage(JSON.stringify({tag, type: 'addTag'}));
      },
      clickIcon(util) {
        if(util.name === 'imageFill') return;
        if(util.name === 'link') {
          this.showInsertLink = true;
          return;
        }
        if(!util.choices) {
          this.addTag(util.tag);
          return;
        }
      },
      addImg(e) {
        let img = e.target.files[0];
        this.$compressImage(img).then(file => {
          let reader = new FileReader();
          reader.onload = () => {
            let url = reader.result;
            let tag = {
              name: 'img',
              type: 'block',
              url
            };
            this.addTag(tag);
            e.target.value = "";
          };
          reader.readAsDataURL(file);
        })
      },
      insertLink(link) {
        console.log('inser link', link);
        this.addTag({
          name: 'a',
          type: 'inline',
          ...link
        });
        this.showInsertLink = false;
      },
      clickChoice(util, choice) {
        let tag = JSON.parse(JSON.stringify(util.tag));
        if(!tag.style) tag.style = {};
        let mergeTag = choice.tag;
        if(mergeTag.name) tag.name = mergeTag.name;
        if(mergeTag.style) {
          Object.keys(mergeTag.style).forEach(key => {
            tag.style[key] = mergeTag.style[key];
          })
        }
        this.addTag(tag);
      },
      getArticle(cb) {
        let listener = (event) => {
          try{
            JSON.parse(event.data);
          } catch {
            return;
          }
          let operation = JSON.parse(event.data);
          if(operation.type === 'sendArticle') {
            this.article.content = operation.content;
            this.article.text = operation.text;
            cb(JSON.parse(JSON.stringify(this.article)));
          }
          window.removeEventListener("message", listener);
        }
        window.addEventListener('message', listener);
        this.$refs.main.contentWindow.postMessage(JSON.stringify({type: 'getArticle'}));
      },
      showChoices(util) {
        if(util.choices) {
          util.showChoices = true;
        }
      },
      fadeChoices(util) {
        if(util.choices) {
          util.showChoices = false;
        }
      },
      fillDraft(draft) {
        let win = this.$refs.main.contentWindow;
        if(this.iframeWindowState) {
          win.postMessage(JSON.stringify({
            type: 'fillDraft',
            draft: draft.content
          }));
        } else {
          win.onload = () => {
            win.postMessage(JSON.stringify({
              type: 'fillDraft',
              draft: draft.content
            }));
          }
        }
        this.article.title = draft.title;
      }
    },
    mounted () {
      this.$refs.main.contentWindow.onload = () => {
        this.iframeWindowState = 1;
      }

      this.utilIcons.forEach(el => {
        el.methodName = 'add' + el.name[0].toUpperCase() + el.name.slice(1);
      });

      window.addEventListener('message', event => {
        let dataStr = event.data, data = null;
        try {
          data = JSON.parse(dataStr);
          if(data.type === 'store') {
            this.$emit('store');
          }
        } catch {
        };
      });

      document.addEventListener("keydown", (event) => {
        if(event.ctrlKey && event.key === 's') {
          event.preventDefault();
          this.$emit('store');
        }
      });
    },
  });

;// CONCATENATED MODULE: ./src/components/utils/RTF/RichTextEditor.vue?vue&type=script&lang=js
 
;// CONCATENATED MODULE: ./src/components/utils/RTF/RichTextEditor.vue




;


const RichTextEditor_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(RichTextEditorvue_type_script_lang_js, [['render',RichTextEditorvue_type_template_id_bef1ad5c_scoped_true_render],['__scopeId',"data-v-bef1ad5c"]])

/* harmony default export */ const RichTextEditor = (RichTextEditor_exports_);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/article/ArticleInfosChoice.vue?vue&type=template&id=aa880d46&scoped=true


const ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_withScopeId = n => ((0,runtime_core_esm_bundler/* pushScopeId */.dD)("data-v-aa880d46"),n=n(),(0,runtime_core_esm_bundler/* popScopeId */.Cn)(),n)
const ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_1 = { class: "cover-wrapper wrapper" }
const ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_2 = /*#__PURE__*/ ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", { class: "w1" }, "封面:", -1 /* HOISTED */))
const ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_3 = { class: "digest-wrapper wrapper" }
const ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_4 = /*#__PURE__*/ ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", { class: "w1" }, "摘要:", -1 /* HOISTED */))
const ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_5 = { class: "type-wrapper wrapper" }
const ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_6 = /*#__PURE__*/ ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", { class: "w1" }, "分类:", -1 /* HOISTED */))
const ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_7 = { class: "tag-wrapper wrapper" }
const _hoisted_8 = /*#__PURE__*/ ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", { class: "w1" }, "文章标签:", -1 /* HOISTED */))
const _hoisted_9 = { class: "original-wrapper wrapper" }
const _hoisted_10 = /*#__PURE__*/ ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", { class: "w1" }, "是否原创", -1 /* HOISTED */))
const _hoisted_11 = { class: "w2" }
const _hoisted_12 = /*#__PURE__*/ ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("label", { for: "original" }, "原创", -1 /* HOISTED */))
const _hoisted_13 = /*#__PURE__*/ ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("label", { for: "reprint" }, "转载", -1 /* HOISTED */))
const _hoisted_14 = { class: "submit-wrapper" }

function ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_cover_upload = (0,runtime_core_esm_bundler/* resolveComponent */.up)("cover-upload")
  const _component_text_area = (0,runtime_core_esm_bundler/* resolveComponent */.up)("text-area")
  const _component_type_list = (0,runtime_core_esm_bundler/* resolveComponent */.up)("type-list")
  const _component_tag_list = (0,runtime_core_esm_bundler/* resolveComponent */.up)("tag-list")

  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("form", {
    class: "article-infos-choice-wrapper",
    onSubmit: _cache[6] || (_cache[6] = (0,runtime_dom_esm_bundler/* withModifiers */.iM)(() => {}, ["prevent"]))
  }, [
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_1, [
      ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_2,
      (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_cover_upload, {
        class: "cover-upload w2",
        ref: "coverUpload"
      }, null, 512 /* NEED_PATCH */)
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_3, [
      ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_4,
      (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_text_area, {
        class: "digest-input w2",
        value: $data.digest,
        "onUpdate:value": _cache[0] || (_cache[0] = $event => (($data.digest) = $event))
      }, null, 8 /* PROPS */, ["value"])
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_5, [
      ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_6,
      (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_type_list, {
        class: "type-list w2",
        types: _ctx.typeNames,
        typeSelect: $data.typeSelect,
        "onUpdate:typeSelect": _cache[1] || (_cache[1] = $event => (($data.typeSelect) = $event))
      }, null, 8 /* PROPS */, ["types", "typeSelect"])
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_hoisted_7, [
      _hoisted_8,
      (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_tag_list, {
        class: "tag-list w2",
        tags: $data.pubTags,
        onAddTag: $options.addTag,
        onDelTag: $options.delTag
      }, null, 8 /* PROPS */, ["tags", "onAddTag", "onDelTag"])
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_9, [
      _hoisted_10,
      (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_11, [
        (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
          type: "radio",
          value: "origin",
          name: "original",
          id: "original",
          "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (($data.original) = $event))
        }, null, 512 /* NEED_PATCH */), [
          [runtime_dom_esm_bundler/* vModelRadio */.G2, $data.original]
        ]),
        _hoisted_12,
        (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
          type: "radio",
          value: "reprint",
          name: "original",
          id: "reprint",
          "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (($data.original) = $event))
        }, null, 512 /* NEED_PATCH */), [
          [runtime_dom_esm_bundler/* vModelRadio */.G2, $data.original]
        ]),
        _hoisted_13
      ])
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_14, [
      (0,runtime_core_esm_bundler/* createElementVNode */._)("button", {
        class: "submit",
        onClick: _cache[4] || (_cache[4] = (0,runtime_dom_esm_bundler/* withModifiers */.iM)((...args) => ($options.submitArticle && $options.submitArticle(...args)), ["prevent"]))
      }, "发布"),
      (0,runtime_core_esm_bundler/* createElementVNode */._)("button", {
        class: "store",
        onClick: _cache[5] || (_cache[5] = (0,runtime_dom_esm_bundler/* withModifiers */.iM)((...args) => ($options.storeArticle && $options.storeArticle(...args)), ["prevent"]))
      }, "存草稿")
    ])
  ], 32 /* HYDRATE_EVENTS */))
}
;// CONCATENATED MODULE: ./src/pages/publish/components/article/ArticleInfosChoice.vue?vue&type=template&id=aa880d46&scoped=true

// EXTERNAL MODULE: ./node_modules/vuex/dist/vuex.esm-bundler.js
var vuex_esm_bundler = __webpack_require__(894);
// EXTERNAL MODULE: ./src/utils/alert.js
var utils_alert = __webpack_require__(7759);
// EXTERNAL MODULE: ./src/components/utils/Input/TextArea.vue
var TextArea = __webpack_require__(8585);
// EXTERNAL MODULE: ./src/pages/publish/components/utils/CoverUpload.vue + 9 modules
var CoverUpload = __webpack_require__(4599);
// EXTERNAL MODULE: ./src/pages/publish/components/utils/TypeList.vue + 4 modules
var TypeList = __webpack_require__(8572);
// EXTERNAL MODULE: ./src/pages/publish/components/utils/TagList.vue + 4 modules
var TagList = __webpack_require__(1631);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/article/ArticleInfosChoice.vue?vue&type=script&lang=js









  /* harmony default export */ const ArticleInfosChoicevue_type_script_lang_js = ({
    components: {
      TextArea: TextArea/* default */.Z,
      CoverUpload: CoverUpload/* default */.Z,
      TypeList: TypeList/* default */.Z,
      TagList: TagList/* default */.Z
    },
    data() {
      return {
        typeSelect: [],
        original: 'origin',
        digest: '',
        pubTags: [],
        cover: null,
        draftId: null,
      }
    },
    computed: {
      ...(0,vuex_esm_bundler/* mapState */.rn)(['tagNames', 'typeNames'])
    },
    methods: {
      addTag(tag) {
        if(this.pubTags.includes(tag)) {
          alert('标签已经添加！');
        } else {
          this.pubTags.push(tag);
        }
      },

      delTag(idx) {
        this.pubTags.splice(idx, 1);
      },

      submitArticle() {
        if(!this.$refs.coverUpload.checkCover()) {
          this.$alert({
            type: 'error',
            content: '请上传封面'
          });
          return;
        } else if(this.typeSelect.every(e => !e)) {
          this.$alert({
            type: 'error',
            content: '请选择分类'
          });
          return;
        }
        this.cover = this.$refs.coverUpload.getCover();
        if(this.cover) {
          this.$compressImage(this.cover).then(res => {
            this.cover = res;
            let data = {
              cover: res,
              tag: this.pubTags.join(','),
              type: this.typeNames.filter((e, idx) => this.typeSelect[idx]).join(','),
              original: this.original === 'origin' ? 1 : 0,
              digest: this.digest
            };
            this.$emit('submitArticle', data);
          })
        } else {
            let data = {
              tag: this.pubTags.join(','),
              type: this.typeNames.filter((e, idx) => this.typeSelect[idx]).join(','),
              original: this.original === 'origin' ? 1 : 0,
              digest: this.digest
            };
            this.$emit('submitArticle', data);
        }
      },

      storeArticle() {
        this.cover = this.$refs.coverUpload.getCover();
        let data;
        if(this.cover) {
          this.$compressImage(this.cover).then(res => {
            this.cover = res;
            data = {
              cover: res,
              tag: this.pubTags.join(','),
              type: this.typeNames.filter((e, idx) => this.typeSelect[idx]).join(','),
              original: this.original === 'origin' ? 1 : 0,
              digest: this.digest
            };
            if(this.draftId) {
              (0,utils_alert/* confirm */.i)("是否覆盖原草稿？", flag => {
                if(flag) {
                  data.draft_id = this.draftId;
                  this.$emit('updateArticleDraft', data);
                }
                else {
                  this.$emit("storeArticle", data);
                }
              });
            } else {
              this.$emit("storeArticle", data);
            }
          })
        } else {
            data = {
              tag: this.pubTags.join(','),
              type: this.typeNames.filter((e, idx) => this.typeSelect[idx]).join(','),
              original: this.original === 'origin' ? 1 : 0,
              digest: this.digest
            };
            (0,utils_alert/* confirm */.i)("是否覆盖原草稿？", flag => {
              if(flag) {
                data.draft_id = this.draftId;
                this.$emit('updateArticleDraft', data);
              }
              else {
                this.$emit("storeArticle", data);
              }
            });
        }
      },

      autoStoreArticle() {
        this.cover = this.$refs.coverUpload.getCover();
        let data;
        if(this.cover) {
          this.$compressImage(this.cover).then(res => {
            this.cover = res;
            data = {
              cover: res,
              tag: this.pubTags.join(','),
              type: this.typeNames.filter((e, idx) => this.typeSelect[idx]).join(','),
              original: this.original === 'origin' ? 1 : 0,
              digest: this.digest
            };
            data.draft_id = this.draftId;
            this.$emit('updateArticleDraft', data);
          })
        } else {
            data = {
              tag: this.pubTags.join(','),
              type: this.typeNames.filter((e, idx) => this.typeSelect[idx]).join(','),
              original: this.original === 'origin' ? 1 : 0,
              digest: this.digest
            };
            data.draft_id = this.draftId;
            this.$emit('updateArticleDraft', data);
        }
      },

      fillDraft(draft) {
        this.draftId = draft.article_id;
        this.$refs.coverUpload.fillCoverByUrl(draft.cover);
        this.original = draft.original ? 'origin' : 'reprint';
        this.digest = draft.digest;
        let typeSelect = new Array(this.typeNames.length);
        this.typeNames.forEach((type, idx) => {
          if(draft.type.includes(type)) typeSelect[idx] = true;
        });
        this.typeSelect = typeSelect;
        this.pubTags = draft.tag;
      }
    },
    mounted() {
      this.typeSelect = new Array(this.typeNames.length).fill(false);
    }
  });

;// CONCATENATED MODULE: ./src/pages/publish/components/article/ArticleInfosChoice.vue?vue&type=script&lang=js
 
;// CONCATENATED MODULE: ./src/pages/publish/components/article/ArticleInfosChoice.vue




;


const ArticleInfosChoice_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(ArticleInfosChoicevue_type_script_lang_js, [['render',ArticleInfosChoicevue_type_template_id_aa880d46_scoped_true_render],['__scopeId',"data-v-aa880d46"]])

/* harmony default export */ const ArticleInfosChoice = (ArticleInfosChoice_exports_);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/PubArticle.vue?vue&type=script&lang=js






  /* harmony default export */ const PubArticlevue_type_script_lang_js = ({
    components: {
      RichTextEditor: RichTextEditor,
      ArticleInfosChoice: ArticleInfosChoice,
    },
    data() {
      return {
        draft: null
      }
    },
    watch: {
      $route: {
        handler(nv, ov) {
          if(nv.path === '/publish/article') {
            (0,assert/* assertLogin */.s)(flag => {
              if(flag) {
                this.fillDraft();
              } else {
                window.open('/', '_self');
              }
            })
          };
        },
        immediate: true
      }
    },
    methods: {
      submitArticle(infos) {
        this.$refs.RTF.getArticle((article) => {
          let payload = {
            ...article,
            ...infos
          };
          if(!infos.digest) {
            payload.digest = article.text.slice(0, 100);
            payload.text = undefined;
          }
          this.$store.commit('pubArticle', payload);
        })
      },
      storeArticle(infos) {
        this.$refs.RTF.getArticle((article) => {
          let payload = {
            ...article,
            ...infos
          };
          if(!infos.digest) {
            payload.digest = article.text.slice(0, 100);
            payload.text = undefined;
          }
          this.$store.commit('storeArticle', payload);
        })
      },
      updateArticleDraft(infos) {
        this.$refs.RTF.getArticle((article) => {
          let payload = {
            ...article,
            ...infos
          };
          this.$store.commit('updateArticleDraft', payload);
        })
      },
      autoUpdateDraft() {
        this.$refs.AIC.autoStoreArticle();
      },
      fillDraft() {
        let draftId = this.$route.query.draft;
        if(draftId === undefined) {
          this.$fetch({
            name: 'article draft',
            url: 'creator/manage/article/draft',
            method: 'GET',
            callback: res => {
              if(res.data.success) {
                if(res.data.object[0]) {
                  let draftId = res.data.object[0].article_id;
                  this.$fetch({
                    name: 'neweset article draft',
                    url: 'creator/article/draft',
                    method: 'POST',
                    data: {
                      id: draftId
                    },
                    callback: res => {
                      if(res.data.success) {
                        this.draft = res.data.object;
                        this.$refs.RTF.fillDraft(this.draft);
                        this.$refs.AIC.fillDraft(this.draft);
                        this.$alert("已获取最新草稿");
                      } else {
                        this.$alert({
                          type: 'error',
                          content: '草稿获取失败'
                        })
                      }
                    }
                  })
                }
              } else {
                this.$alert({
                  type: 'error',
                  content: res.data.message
                });
              }
            }
          })
        }
        else {
          this.$fetch({
            name: 'article draft',
            url: 'creator/article/draft',
            method: 'POST',
            data: {
              id: draftId
            },
            callback: res => {
              if(res.data.success) {
                this.draft = res.data.object;
                this.$refs.RTF.fillDraft(this.draft);
                this.$refs.AIC.fillDraft(this.draft);
              } else {
                this.$alert({
                  type: 'error',
                  content: '获取草稿失败'
                })
              }
            }
          })
        }
      }
    },
  });

;// CONCATENATED MODULE: ./src/pages/publish/components/PubArticle.vue?vue&type=script&lang=js
 
;// CONCATENATED MODULE: ./src/pages/publish/components/PubArticle.vue




;


const PubArticle_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(PubArticlevue_type_script_lang_js, [['render',render],['__scopeId',"data-v-5129fa5a"]])

/* harmony default export */ const PubArticle = (PubArticle_exports_);

/***/ }),

/***/ 4599:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ CoverUpload)
});

// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
// EXTERNAL MODULE: ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
var runtime_dom_esm_bundler = __webpack_require__(9963);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/CoverUpload.vue?vue&type=template&id=c182d43a&scoped=true


const _withScopeId = n => ((0,runtime_core_esm_bundler/* pushScopeId */.dD)("data-v-c182d43a"),n=n(),(0,runtime_core_esm_bundler/* popScopeId */.Cn)(),n)
const _hoisted_1 = { class: "cover-upload-wrapper" }
const _hoisted_2 = { class: "cover-radio" }
const _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("label", { for: "singleCover" }, "单封面", -1 /* HOISTED */))
const _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("label", { for: "noCover" }, "无封面", -1 /* HOISTED */))

function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_image_input = (0,runtime_core_esm_bundler/* resolveComponent */.up)("image-input")

  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div", _hoisted_1, [
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_2, [
      (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
        type: "radio",
        value: "1",
        name: "coverType",
        id: "singleCover",
        checked: "",
        "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.coverNum) = $event))
      }, null, 512 /* NEED_PATCH */), [
        [runtime_dom_esm_bundler/* vModelRadio */.G2, $data.coverNum]
      ]),
      _hoisted_3,
      (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
        type: "radio",
        name: "coverType",
        id: "noCover",
        value: "0",
        "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.coverNum) = $event))
      }, null, 512 /* NEED_PATCH */), [
        [runtime_dom_esm_bundler/* vModelRadio */.G2, $data.coverNum]
      ]),
      _hoisted_4
    ]),
    (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_image_input, {
      class: "cover-upload",
      image: $data.cover,
      "onUpdate:image": _cache[2] || (_cache[2] = $event => (($data.cover) = $event))
    }, null, 8 /* PROPS */, ["image"]), [
      [runtime_dom_esm_bundler/* vShow */.F8, parseInt($data.coverNum)]
    ])
  ]))
}
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/CoverUpload.vue?vue&type=template&id=c182d43a&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/Input/ImageInput.vue?vue&type=template&id=813c8588&scoped=true


const ImageInputvue_type_template_id_813c8588_scoped_true_withScopeId = n => (_pushScopeId("data-v-813c8588"),n=n(),_popScopeId(),n)
const ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_1 = { class: "image-input-wrapper" }
const ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_2 = { class: "image-submit-cover" }
const ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_3 = ["src"]

function ImageInputvue_type_template_id_813c8588_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("form", ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_1, [
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_2, [
      (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("img", {
        ref: "cover",
        src: $data.imageUrl,
        alt: "image",
        class: "cover-image"
      }, null, 8 /* PROPS */, ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_3), [
        [runtime_dom_esm_bundler/* vShow */.F8, $data.imageUrl]
      ]),
      (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("span", null, "upload", 512 /* NEED_PATCH */), [
        [runtime_dom_esm_bundler/* vShow */.F8, !$data.imageUrl]
      ])
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
      type: "file",
      name: "image",
      class: "image-input",
      ref: "imageInput",
      onInput: _cache[0] || (_cache[0] = $event => ($options.handleInput($event)))
    }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)
  ]))
}
;// CONCATENATED MODULE: ./src/components/utils/Input/ImageInput.vue?vue&type=template&id=813c8588&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/Input/ImageInput.vue?vue&type=script&lang=js

  /* harmony default export */ const ImageInputvue_type_script_lang_js = ({
    emits: ['update:image'],
    props: {
      image: {
        type: File,
        default: null
      },
    },
    data() {
      return {
        imageUrl: ""
      }
    },
    watch: {
      image(newValue) {
        if(!(newValue instanceof Blob)) return;
        let reader = new FileReader();
        reader.addEventListener('load', () => {
          this.imageUrl = reader.result;
        });
        reader.readAsDataURL(this.image);
      }
    },
    methods: {
      handleInput(event) {
        this.$emit('update:image', event.target.files[0]);
      }
    },
  });

;// CONCATENATED MODULE: ./src/components/utils/Input/ImageInput.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/components/utils/Input/ImageInput.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(ImageInputvue_type_script_lang_js, [['render',ImageInputvue_type_template_id_813c8588_scoped_true_render],['__scopeId',"data-v-813c8588"]])

/* harmony default export */ const ImageInput = (__exports__);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/CoverUpload.vue?vue&type=script&lang=js



  /* harmony default export */ const CoverUploadvue_type_script_lang_js = ({
    components: {
      ImageInput: ImageInput,
    },
    props: {
    },
    data() {
      return {
        coverNum: "1",
        cover: null,
      }
    },
    methods: {
      updateCover(image) {
        this.cover = image;
      },
      checkCover() {
        return parseInt(this.coverNum) && this.cover || !parseInt(this.coverNum);
      },
      getCover() {
        return parseInt(this.coverNum) ? this.cover : null;
      },
      fillCoverByUrl(url) {
        if(!url) {
          this.coverNum = "0";
        }

        this.$file.imgurlToImg(this.$baseURL + url).then(img => {
          return this.$file.imgToCanvas(img);
        }).then(canvas => {
          this.$file.canvasToBlob(canvas, 1, blob => {
            this.cover = new File([blob], this.$file.getFileName(url));
          })
        })
      }
    },
  });

;// CONCATENATED MODULE: ./src/pages/publish/components/utils/CoverUpload.vue?vue&type=script&lang=js
 
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/CoverUpload.vue




;


const CoverUpload_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(CoverUploadvue_type_script_lang_js, [['render',render],['__scopeId',"data-v-c182d43a"]])

/* harmony default export */ const CoverUpload = (CoverUpload_exports_);

/***/ }),

/***/ 1631:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ TagList)
});

// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
// EXTERNAL MODULE: ./node_modules/@vue/shared/dist/shared.esm-bundler.js
var shared_esm_bundler = __webpack_require__(3577);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/TagList.vue?vue&type=template&id=11b33240&scoped=true


const _withScopeId = n => (_pushScopeId("data-v-11b33240"),n=n(),_popScopeId(),n)
const _hoisted_1 = { class: "tag-list-wrapper clearfix" }
const _hoisted_2 = ["onClick"]
const _hoisted_3 = {
  type: "text",
  ref: "tagInput"
}

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("ul", _hoisted_1, [
    ((0,runtime_core_esm_bundler/* openBlock */.wg)(true), (0,runtime_core_esm_bundler/* createElementBlock */.iD)(runtime_core_esm_bundler/* Fragment */.HY, null, (0,runtime_core_esm_bundler/* renderList */.Ko)($props.tags, (tag, idx) => {
      return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("li", { key: idx }, [
        (0,runtime_core_esm_bundler/* createTextVNode */.Uk)((0,shared_esm_bundler/* toDisplayString */.zw)(tag) + " ", 1 /* TEXT */),
        (0,runtime_core_esm_bundler/* createElementVNode */._)("i", {
          class: "iconfont icon-cancel",
          onClick: $event => ($options.delTag(idx))
        }, null, 8 /* PROPS */, _hoisted_2)
      ]))
    }), 128 /* KEYED_FRAGMENT */)),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("li", null, [
      (0,runtime_core_esm_bundler/* createElementVNode */._)("input", _hoisted_3, null, 512 /* NEED_PATCH */),
      (0,runtime_core_esm_bundler/* createElementVNode */._)("button", {
        class: "submit-button",
        onClick: _cache[0] || (_cache[0] = (...args) => ($options.addTag && $options.addTag(...args)))
      }, "+")
    ])
  ]))
}
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TagList.vue?vue&type=template&id=11b33240&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/TagList.vue?vue&type=script&lang=js

  /* harmony default export */ const TagListvue_type_script_lang_js = ({
    props: {
      tags: {
        type: Array,
        default: () => []
      },
    },
    methods: {
      addTag() {
        this.$emit('addTag', this.$refs.tagInput.value);
        this.$refs.tagInput.value = '';
      },
      delTag(idx) {
        this.$emit('delTag', idx);
      }
    },
  });

;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TagList.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TagList.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(TagListvue_type_script_lang_js, [['render',render],['__scopeId',"data-v-11b33240"]])

/* harmony default export */ const TagList = (__exports__);

/***/ }),

/***/ 8572:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ TypeList)
});

// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
// EXTERNAL MODULE: ./node_modules/@vue/shared/dist/shared.esm-bundler.js
var shared_esm_bundler = __webpack_require__(3577);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/TypeList.vue?vue&type=template&id=32678592&scoped=true


const _withScopeId = n => (_pushScopeId("data-v-32678592"),n=n(),_popScopeId(),n)
const _hoisted_1 = { class: "type-list-wrapper clearfix" }
const _hoisted_2 = ["onClick"]

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("ul", _hoisted_1, [
    ((0,runtime_core_esm_bundler/* openBlock */.wg)(true), (0,runtime_core_esm_bundler/* createElementBlock */.iD)(runtime_core_esm_bundler/* Fragment */.HY, null, (0,runtime_core_esm_bundler/* renderList */.Ko)($props.types, (type, idx) => {
      return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("li", {
        key: idx,
        class: (0,shared_esm_bundler/* normalizeClass */.C_)({
      bgSlightBlue: $props.typeSelect[idx],
      colorBlue: $props.typeSelect[idx]
    }),
        onClick: $event => ($options.toggleSelect(idx))
      }, (0,shared_esm_bundler/* toDisplayString */.zw)(type), 11 /* TEXT, CLASS, PROPS */, _hoisted_2))
    }), 128 /* KEYED_FRAGMENT */))
  ]))
}
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TypeList.vue?vue&type=template&id=32678592&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/TypeList.vue?vue&type=script&lang=js

  /* harmony default export */ const TypeListvue_type_script_lang_js = ({
    props: {
      types: {
        type: Array,
        default: () => []
      },
      typeSelect: {
        type: Array
      }
    },
    emits: ['update:typeSelect'],
    methods: {
      toggleSelect(idx) {
        let update = Array.from(this.typeSelect);
        update[idx] = !update[idx];
        this.$emit('update:typeSelect', update);
      }
    },
  });

;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TypeList.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TypeList.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(TypeListvue_type_script_lang_js, [['render',render],['__scopeId',"data-v-32678592"]])

/* harmony default export */ const TypeList = (__exports__);

/***/ }),

/***/ 1061:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* reexport safe */ _node_modules_vue_loader_dist_index_js_ruleSet_1_rules_12_use_0_TextArea_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__.Z)
/* harmony export */ });
/* harmony import */ var _node_modules_vue_loader_dist_index_js_ruleSet_1_rules_12_use_0_TextArea_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6766);
 

/***/ }),

/***/ 6076:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "s": () => (/* reexport safe */ _node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_1_node_modules_vue_loader_dist_index_js_ruleSet_1_rules_12_use_0_TextArea_vue_vue_type_template_id_8551dff6_scoped_true__WEBPACK_IMPORTED_MODULE_0__.s)
/* harmony export */ });
/* harmony import */ var _node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_1_node_modules_vue_loader_dist_index_js_ruleSet_1_rules_12_use_0_TextArea_vue_vue_type_template_id_8551dff6_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9918);


/***/ }),

/***/ 9918:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "s": () => (/* binding */ render)
/* harmony export */ });
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6252);


const _withScopeId = n => (_pushScopeId("data-v-8551dff6"),n=n(),_popScopeId(),n)
const _hoisted_1 = { class: "text-area-wrapper" }
const _hoisted_2 = ["value"]

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,vue__WEBPACK_IMPORTED_MODULE_0__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createElementBlock */ .iD)("div", _hoisted_1, [
    (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createElementVNode */ ._)("textarea", {
      name: "abstract",
      value: $props.value,
      onInput: _cache[0] || (_cache[0] = $event => ($options.handleInput($event))),
      cols: "30",
      rows: "5"
    }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_2)
  ]))
}

/***/ }),

/***/ 4442:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "s": () => (/* binding */ assertLogin)
/* harmony export */ });
/* harmony import */ var _alert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7759);


function assertLogin(cb) {
  if(!window.sessionStorage.getItem('isLogin')) {
    (0,_alert__WEBPACK_IMPORTED_MODULE_0__/* .alert */ .Z)({
      type: 'error',
      content: '请先登录'
    }, cb);
  } else {
    if(typeof cb === 'function') cb(true);
  }
}



/***/ })

}]);